﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.CMS263.PO;
using Com.CMS263.DAO;

namespace Com.CMS263.BLL
{
    public class ProdTypeBLL:BaseBLL<ProdType>
    {
        public ProdTypeDAO dao = new ProdTypeDAO();
        public ProdType entity = new ProdType();

        public override ProdType GetModel()
        {
            return entity;
        }
        #region 查询所有list
        /// <summary>
        /// 查询所有list
        /// </summary>
        /// <param name="page"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public IList<ProdType> GetAll(int page, int pagesize,string key)
        {
            try
            {
                return dao.GetAll(page, pagesize,key);
            }
            catch (Exception)
            {

                return null;
            }
        }
        #endregion

        #region 查询所有总数
        /// <summary>
        /// 查询所有总数
        /// </summary>
        /// <returns></returns>
        public int GetAll(string key)
        {
            return dao.GetAll(key);
        }
        #endregion

        public IList<ProdType> FindAll()
        {
            return dao.FindAll();
        }
         #region 根据id查询实体
        /// <summary>
        /// 根据id查询实体
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ProdType GetProdTypeById(int id)
        {
            return dao.GetProdTypeById(id);
        }
        #endregion
    }
}
